/*
 * @Author: 45F
 * @LastEditors: 45F
 * @Description: 全局mixins
 * @Date: 2019-07-06 09:41:48
 * @LastEditTime: 2019-07-18 16:09:45
 */
export const publicMixins = {
  methods: {
    convertDateFromString: (dateString, fmt) => {
      if (dateString) {
        if (fmt === 'yyyy-MM-dd' || fmt === 'yyyy-MM-dd hh:mm:ss') {
          return new Date(dateString.replace(/-/, '/'))
        } else {
          return null
        }
      } else {
        return null
      }
    }
  }
}
